<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="/js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/css/my-css.css" />
    <script type="text/javascript" src="/js/my-js.js" ></script>
    <script type="text/javascript" src="/js/jquery.cookie.js" ></script>
    <script type="text/javascript" src="/js/vue.min.js" ></script>
    <script type="text/javascript" src="/js/marked.min.js" ></script>
    <title>Java学习网</title>
    <style type="text/css">
        body {font-family: "微软雅黑";}
        #content img {
            max-width: 95%;
            min-width: 400px;
            margin: 10px 0 10px 0;
        }
    </style>
</head>
<body>
    <div id="header"></div>
    <script type="text/javascript">moralLoad("#header", "/html/header.html")</script>
    <div class="container">
        <div class="row" id="app" v-cloak>
            <div class="col-xs-offset-1 col-xs-10">
                <ol class="breadcrumb" style="background-color: inherit; margin-bottom: 0;">
                    <li><a href="#">首页</a></li>
                    <li><a href="/examples">实例教程</a></li>
                    <li class="active" v-text="title"></li>
                </ol>
            </div>
            <div class="col-xs-offset-1 col-xs-10 panel panel-default">
                <h3><b v-text="title"></b></h3><hr />
                <div class="panel panel-primary">
	                <div class="panel-heading">
	                   <h3 class="panel-title">教程附件（点击即可下载）</h3>
	                </div>
	                <div class="panel-body">
	                   <div v-for="file in attachment">
	                       <h4><a v-text="file.title" v-bind:href="file.filePath" target="_blank"></a></h4>
	                   </div>
	                </div>
                </div>
                <div class="panel-body" id="content"></div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
    var example;
    myAjax({
        type: 'get',
        url: document.location.pathname,
        async: false,
        success: function(data) {example=data}
    });
    myAjax({
        type: 'get',
        url: example.docFilePath,
        async: false,
        dataType: 'text',
        success: function(data) {
            $("#content").html(marked(data));
        }
    })
    new Vue({
        el: "#app",
        data: example
    });
</script>
</html>